package com.biz.primus.model.member.enums;

import com.biz.primus.common.enums.EnumerableValue;
import com.biz.primus.common.enums.converter.BaseEnumValueConverter;

/**
 * 学历枚举
 *
 * @author jun.liu
 * <br>2017年10月13日
 */
public enum EducationTypes implements EnumerableValue
{

//    DOCTORATE(1, "博士"),
//    GRADUATE(2, "研究生"),
//    UNDERGRADUATE(3, "本科"),
//    SPECIALTY(4, "专科"),
//    HIGH_SCHOOL(5, "高中");
//
    secret(0,"保密"),
    lower_middle_school(1,"初中及以下"),
    high_school(2,"高中"),
    college(3,"大学"),
    upper_graduate(4,"研究生及以上")
    ;

    public static class Converter extends BaseEnumValueConverter<EducationTypes>
    {
    }

    private int value;
    private String desc;

    EducationTypes(int value, String desc)
    {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static EducationTypes getEducationByValue(int codeVal)
    {
        for (EducationTypes education : EducationTypes.values())
        {
            if (education.getValue() == codeVal)
            {
                return education;
            }
        }
        return null;
    }


}
